home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: BALROG.NCI.NIH.GOV!SYSTEX
- From: systex@BALROG.NCI.NIH.GOV (Donald G. Plugge, Systex Inc., (301)931-0500)
- Subject: The philosophy of file I/O.
- Message-ID: <1996Mar19.155703.26730@alw.nih.gov>
- Sender: postman@alw.nih.gov (AMDS Postmaster)
- Nntp-Posting-Host: balrog.nci.nih.gov
- Reply-To: systex@BALROG.NCI.NIH.GOV
- Organization: Organization, City, State, etc.
- Date: Tue, 19 Mar 1996 15:57:03 GMT
-
-
- As a new convert to the C++ language, I'd like my practical application coding
- to not only work, but to match the philosophy of object oriented guidelines.
- I'd like to get input from the C++ community on designing an actual solution.
- The goal of my small application is to read a particular type of file format
- and perform calculations on the data. I've been reading numerous books on the
- subject of both C++ and object oriented programming, however, I'm keeping two
- in mind while attacking this problem -- An Introduction To Object-Oriented
- Programming by Timothy Budd and C++ IOStreams Handbook by Steve Teale. The
- first book deals with the general concepts and the second deals with IO
- specifically.
-
- The format of the files to be read are comprised of three sections as follows:
-
- 1) A fixed format section containing an identifier and two sets of pointers.
- This section is of a fixed length. The first set of pointers are byte offsets
- into the second section. The second set of pointers are byte offsets into the
- third section.
-
- 2) Text area which describes the data.
-
- 3) Data area containing binary data.
-
- I'd like to use the CRC method of design outlined by Timothy Budd. For those
- of you unfamiliar with this method, individual classes are written on cue cards
- along with class methods and other relavent class information. So, I'd like to
- break down the above problem in this manner.
-
- I was thinking of creating the following classes, but don't really know why:
-
- 1) File Selection and control - a class to select the desired file, open the
- file for reading, close the file and check the file status.
-
- 2) Pointers - a class to handle the pointers.
-
- 3) Text Area - a class for reading and searching the text area.
-
- 4) Data Area - a class for reading the data area and performing calculations.
-
- Would anyone like to point out why or why not I'd like to break down the
- problem in this manner? And how I may communicate between classes? For
- instance, does the File control class want to perform all IO operations or
- perhaps it would pass the file id to the other classes, so they can read their
- respective areas. The coding details aren't as important at this point. I'd
- like to understand the philosophy of file IO. Other references would be
- appriciated.
-
- Thanks,
- Donald G. Plugge
-